﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Super_Wall_Breaker.Sources.GameElements.Bricks;
using Microsoft.Xna.Framework;

namespace Super_Wall_Breaker.Sources.Factories
{
    /// <summary>
    /// This class create bricks.
    /// </summary>
    public static class BrickFactory
    {
        /// <summary>
        /// This function creates a basic brick. 
        /// </summary>
        /// <param name="lifetime"> The life of the brick</param>
        /// <param name="position"> The position of the brick</param>
        /// <param name="sourceRectangle"> The source rectangle of the brick, ie the rectangle used in the spritesheet, to get the texture.</param>
        /// <returns></returns>
        public static Brick createBasicBrick(int lifetime,Vector2 position,Rectangle? sourceRectangle)
        {
            //Add item code
            return new BasicBrick(lifetime,position,sourceRectangle);
        }

        /// <summary>
        /// This function returns the color linked to the number of life of a brick.
        /// </summary>
        /// <param name="life"> The brick's life.</param>
        /// <returns> Returns the color linked to the brick's life.</returns>
        public static Color GetBrickColor(int life)
        {
            Color color = Color.White;

            switch (life)
            {
                case 2: color = Color.LightBlue; break;
                case 3: color = Color.LightGreen; break;
                case 4: color = Color.LightSlateGray; break;
                case 5: color = Color.LightCoral; break;
            }

            return color;
        }
    }
}
